package mine.auction;

import java.util.Collection;

public interface IAuction {

	/**
	 * Add a new item into the mine.auction.
	 * 
	 * @param description
	 *            A description of the item.
	 * @return item id
	 * 			  The identifier of the item
	 */
	public int addItem(String description);

	/**
	 * Record a user's bid on an item. A boolean is returned to indicate if the
	 * bid is successful (true) or not (false)
	 * 
	 * @param number
	 *            The item number being bid for.
	 * @param bidder
	 *            The person bidding for the item.
	 * @param value
	 *            The value of the bid.
	 * @return true if successful, false if not.
	 */
	public boolean recordBid(int itemNumber, User bidder, long value);

	/**
	 * Get the current winning bid for an item.
	 * 
	 * @param number
	 *            The item number.
	 * @return bid The highest bid for this item if it exists, null otherwise.
	 * 
	 */
	public Bid getHighestBid(int number);
	
	/**
	 * Get all the bids for an item.
	 * 
	 * @param number
	 *            The item number.
	 * @return bid The list of bids for this item if it exists, null otherwise.
	 */
	public Collection<Bid> getBids(int number);
	
	/**
	 * Get all the items on which a user has bid.
	 * 
	 * @param user
	 *            The user.
	 * @return The list of items that the user has bid for if any, null
	 *         otherwise.
	 */
	public Collection<Item> getItemsBidBy(User user);
	
	/**
	 * Print the full list of item numbers and item descriptions in this mine.auction.
	 * Include any details of the highest bids.
	 */
	public void printItems();
	
	/**
	 * Print the list of item numbers and item descriptions in this mine.auction for a given user.
	 */
	public void printItems(User user);


	/**
	 * Return the item with the given number. Return null if a item with this
	 * number does not exist.
	 * 
	 * @param number
	 *            The number of the item to return.
	 */
	public Item getItem(int number);

}